#!/usr/bin/env node

import { readFile } from 'fs/promises'

async function main(){
  try{
    const file = process.argv[2];
    const content = await readFile(file, 'utf-8');
    console.log(content);
  } catch (err) {
    console.error(err.message);
  }
}
main();


//const fs = require('fs'),
//     file = process.argv[2];

//fs.readFile(file, 'utf-8', (err,data)=>{
//  if(err){
//    console.error(err.message);
//    return;
// }
//  const lines = data.split(.\n);
//  for(let i=1; i<lines; i++){
//    console.log(`${i}\t${lines[i-1]}`);
//  }
//});
